using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace BetaIto.ChaosDAV
{
    public partial class TransferForm : Form
    {
        public TransferForm()
        {
            InitializeComponent();
            _setPathDelegate += SetPathCallback;
            //_setStatus += SetStatus;
            _setStatusDelegate += SetStatusCallback;
        }

        private void TransferForm_Load(object sender, EventArgs e)
        {
//            Parent.Enabled = false;
        }

        protected delegate void SetPathDelegate(string path);
        protected SetPathDelegate _setPathDelegate;
        protected delegate void SetStatusDelegate(string status);
        protected SetStatusDelegate _setStatusDelegate;

        protected void SetPathCallback(string path)
        {
            _targetUrlText.Text = path;
        }

        protected void SetStatusCallback(string status)
        {
            _statusText.Text = status;
        }

        public void SetStatus(string status)
        {
            Invoke(_setStatusDelegate, new object[] { status });
        }

        public void SetPath(string path)
        {
            Invoke(_setPathDelegate, new object[] { path });
        }

        private void TransferForm_FormClosed(object sender, FormClosedEventArgs e)
        {
//            Parent.Enabled = true;
        }
    }
}